﻿using System;
using System.CodeDom.Compiler;

namespace SWF
{
    public struct PrimitiveFloat : IPrimitive
    {
        public PrimitiveType PrimitiveType { get { return PrimitiveType.Float; } }
        public object Value { get { return FloatValue; } }
        public int Length { get { return 4 + 1; } }
        public float FloatValue;

        public PrimitiveFloat(SwfReader r)
        {
            FloatValue = r.GetFixedNBits(32);
        }

        public void ToFlashAsm(IndentedTextWriter w)
        {
            w.Write(FloatValue);
        }
    }
}
